package edu.njit.hz278.core.web;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class JSONWriter implements Writer {

	@Override
	public void write(HttpServletRequest req, HttpServletResponse resp,
			Object... args) throws IOException {
		assert args.length >= 1;
		resp.setContentType("application/json");
		JSONMapper.writeJSON(resp.getOutputStream(), args[0]);
	}

}
